<template>
	<div>
		<el-table stripe border :data="bannerList" style="width: 100%; text-align: center;">
			<el-table-column prop="id" label="序列号" width="180"></el-table-column>
			<el-table-column label="图片" width="280">
				<template #default="scope">
					<el-image :src="scope.row.url"></el-image>
				</template>
			</el-table-column>
			<el-table-column prop="content" label="描述" />

			<el-table-column label="操作" width="280">
				<template #default="scope">
					<el-button size="small" >编辑</el-button>
					<el-button size="small" type="danger" >删除</el-button>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
import { RequestBanner } from '@/api/banner.js'
export default {
	data() {
		return {
			bannerList: [],
		}
	},
	created() {
		this.onRequestBanner()
	},
	methods: {
		async onRequestBanner() {
			let data = await RequestBanner()
			let { resultCode, resultInfo } = data
			if (resultCode == 1) {
				this.bannerList = resultInfo.list
			}
		},
	},
}
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>
